<?php 

require_once('../shared/connect.php');

if (!empty($_POST['json_address'])) {

	$json_address = json_decode($_POST['json_address']);


		$sql = "INSERT INTO location (assoc_id, van, type, address, num_people, 
									  total_wait, start_time, last_updated)
							VALUES (NULL, '$_POST[van]', 'VAN', '$_POST[address]',
									'$_POST[num_people]', '$_POST[total_wait]', 
									'$current_time', '$current_time')";


	$sql = "UPDATE location SET address = '$json_address->address' 
			WHERE id = '$json_address->id'";

	$update = mysql_query($sql) or die(mysql_error());
}

//touch('last_updated');

?>